<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/include-base-js.jsp" %>
<%@ include file="/common/include-form-js.jsp" %>
<script type="text/javascript" src="${ctx }/static/js/plug/layer/layer.js" ></script>
<script type="text/javascript"  src="${ctx }/static/js/pager.js"/></script>
<link href="${ctx }/static/css/ui_page.css" rel="stylesheet" type="text/css" />
<script>
$(function(){
	$(document).keydown(function(e){
		if(e.keyCode==13){
			$('#searchForm .sub').click();//处理事件
		}
	}); 
	$('#searchForm input').bind('keydown',function(event){
        if(event.keyCode == "13")    
        {
        	$('#searchForm .sub').click();//处理事件
        }
    });
	$(".reset").live("click",function(){
		var from = $(this).parents("form").get(0);
		$(from).clearForm();
		$(from).find("input:text").val("");
		$(from).find("input:number").val("");
		$(from).find("input:radio").val("");
		$(from).find("input:date").val("");
		$(from).find("input:checkbox").val("");
		$(from).find("select").val("");
	});
	$(".sub").live("click",function(){
		$('#page').val(1);
		return true;
	});
	
});
var pageType =  $("#pageType").val();
if(pageType!="1"){
	
	var url = $("#searchForm").attr("action");
	function pages(){
		var page = $('#page').val();
		if(page==null || page==''){
			page=1;
		}
		var pageSize = $('#pageSize').val();
		if(pageSize==null || pageSize==''){
			pageSize=$CONFIG.pageSize;
			$('#pageSize').val(pageSize);
		}
		new Pager('.ui-page',{
			curPage : page,
			pageSize : pageSize,
			totalCount : $('#count').val(),
			onClick : function(p){
				var form = $('#searchForm');
				$('#page').val(p);
				form.action=url;
				form.submit();
			}
		});
	}
	pages();
	function onchangesel(obj){
		var pagesize = $(obj).val();
		$('#pageSize').val(pagesize);
		$('#page').val(1);
		var form = $('#searchForm');
		form.action=url;
		form.submit();
	}
	
	
}


//------


 </script>
